Skip to content

隐藏模块高级 - HideModuleEx

函数简介

目标窗口所属进程中隐藏指定模块,并返回隐藏上下文句柄。

隐藏上下文保存在目标进程 VirtualAlloc 内存中,DLL 卸载后仍有效;恢复时请用 UnhideModuleEx

接口名称

HideModuleEx

DLL调用

c
long HideModuleEx(long instance, long hwnd, string moduleName);

参数说明

参数名类型说明
instance长整数型OLAPlug实例指针,由 CreateCOLAPlugInterFace 接口生成。
hwnd长整数型目标窗口句柄,用于定位目标进程。
moduleName字符串模块名称,例如 XXX.dll,须为目标进程中已加载的模块。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long handle = ola.HideModuleEx(hwnd, "XXX.dll");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
long handle = ola.HideModuleEx(hwnd, "XXX.dll");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
handle = ola.HideModuleEx(hwnd, "XXX.dll")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
long handle = ola.HideModuleEx(hwnd, "XXX.dll");
go
import "github.com/ola/olaplug/olaplug"

ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
handle := ola.HideModuleEx(hwnd, "XXX.dll")
rust
use olaplug::OLAPlugServer;

let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let handle = ola.hide_module_ex(hwnd, "XXX.dll");
cpp
var ola = com("OlaPlug.OlaSoft")
var handle = ola.HideModuleEx(hwnd, "XXX.dll")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
handle = ola.HideModuleEx(hwnd, "XXX.dll")
text
.局部变量 ola, OLAPlug
ola.创建 ()
handle = ola.HideModuleEx(hwnd, “XXX.dll”)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var handle = ola.HideModuleEx(hwnd, "XXX.dll");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
长整数 handle = ola.HideModuleEx(hwnd, “XXX.dll”)
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
long handle = ola.HideModuleEx(hwnd, "XXX.dll");

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
HideModuleEx(instance, hwnd, "XXX.dll");
csharp
using System.Runtime.InteropServices;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long HideModuleEx(long ola, long hwnd, string moduleName);

long instance = CreateCOLAPlugInterFace();
HideModuleEx(instance, hwnd, "XXX.dll");
python
from ctypes import CDLL, c_int64

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.HideModuleEx(instance, hwnd, b"XXX.dll")

返回值

返回值说明
(返回值)- 成功:返回隐藏上下文句柄(目标进程地址空间指针),须用 UnhideModuleEx 恢复。 - 失败:返回 0

注意事项

项目说明
与 HideModule 区别HideModule 仅隐藏本进程模块;本接口隐藏其他进程模块。
上下文不可混用返回的 ctx 不可传给本机 UnhideModule
隐藏风险隐藏模块可能导致未知问题,请谨慎使用。